package com.hsp.Demo_12_enum;

public class Demo_04 {
    public static void main(String[] args) {
        Weekday[] values = Weekday.values();
        System.out.println("=====所有星期信息如下=====");
        for(Weekday value : values){
//            System.out.println(value.getName());\
            System.out.println(value);
        }
    }
}

enum Weekday{

    MONDAY("星期一"),TUESDAY("星期二"),WEDNESDAY("星期三"),THURSDAY("星期四"),
    FRIDAY("星期五"),SATURDAY("星期六"),SUNDAY("星期天");

    private String name;

    private Weekday(){}
    private Weekday(String name){
        this.name = name;
    }

    public String getName(){
        return this.name;
    }

    @Override
    public String toString() {
        return name;
    }
}